package cn.hou.java.designpattern._03proprtype;

import java.util.ArrayList;
import java.util.List;

public class Test01 {
	
	public static void main(String[] args) throws Exception {
		Person person01=new Person();
		person01.setAge("18");
		person01.setName("yaozhen");
		List list01=new ArrayList();
		list01.add("heyi");
		list01.add("cuijie");
		person01.setFriends(list01);
		//克隆一个person
		Person person02 = person01.clone();
		System.out.println(person01);
		System.out.println(person02);
		//该表本体的list
		list01.add("lishibiao");
		System.out.println(person01);
		System.out.println(person02);//不会改变,深度克隆,浅克隆会改变
	}

}
